package com.sport.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sport.entity.SysPermission;
import com.sport.entity.SysUser;
import com.sport.entity.dto.Option;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
    List<Option> getRolesByUserId(@Param("userId") Integer userId);

    void insertRoleIds(@Param("userId") Integer userId, @Param("roleIds") List<String> roleIds);

    void deleteRoleByUserId(@Param("userId") Integer userId);

    List<String> getRoleCodeByUserId(@Param("userId") String userId);

    List<String> listPermissionByRoleCode(@Param("roleCode") String roleCode);

    List<SysPermission> listParentMenuByUserId(@Param("userId") String userId);

    List<SysPermission> listMenuByUserId(@Param("userId") String userId,@Param("parentId") String parentId);
}
